package com.gdut.Demo2;

public class Product {
    private static String company;
    private String name;
    private String ID;
    private int library;
    private double prise;

    public Product() {
    }

    public Product(String company) {
        Product.company = company;
    }

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setPrise(double prise) {
        if (prise > 0 && prise < 1000000) {
            this.prise = prise;
        } else {
            System.out.println("非法数据赋值！");
        }
    }

    public double getPrise() {
        return prise;
    }

    public void setLibrary(int library) {
        if (library >= 0 && library < 1000000) {
            this.library = library;
        } else {
            System.out.println("非法数据赋值！");
        }
    }

    public int getLibrary() {
        return library;
    }

    public void information() {
        System.out.println(company);
        System.out.println(name);
        System.out.println(ID);
        System.out.println(library);
        System.out.println(prise);
    }
}
